package com.learn.scrm;

import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.util.LinkedMultiValueMap;

import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author : Yu.Tan
 * @date : 2023/2/23 23:43
 * @desc : **
 */
public class MapTest {
    public static void main(String[] args) {


        Date date = DateUtil.endOfDay(DateUtil.offsetHour(DateUtil.beginOfSecond(new Date()), 96)).toJdkDate();

        System.out.println(DateUtil.format(date, DatePattern.NORM_DATETIME_MS_PATTERN));
        date = DateUtil.beginOfSecond(date).toJdkDate();
        System.out.println(DateUtil.format(date, DatePattern.NORM_DATETIME_MS_PATTERN));



        Map<Object,Object> map1=new HashMap<>();
        map1.put(1,"123");
        map1.put("123","123");
        map1.put(12.1,"123");
        System.out.println(map1);


        String s = new String("1");
        String s1 = new String("1");
        System.out.println(s==s1);
        System.out.println(s.equals(s1));
        System.out.println(s.hashCode()==s1.hashCode());
        Map<String,String> stringStringMap=new HashMap<>();
        stringStringMap.put(s,"1");
        stringStringMap.put(s1,"1");
        System.out.println(stringStringMap);


        LinkedMultiValueMap<String, String> map = new LinkedMultiValueMap<>();

        map.add("1","1");
        map.add("1","2");
        System.out.println(map);


        System.out.println("2023-04-10".length());
    }

    @Data
    @AllArgsConstructor
    public static class Key{
       private String key;
    }
}
